﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;

namespace Classes
{
   public class Equipment : IComparable<Equipment>
   {
      #region Private Member Variables

         private String manufacturer;
         private String partNumber;
         private String description;
         private double points;
         private Boolean drop;

      #endregion

      #region Properties

         public String PartNumber { get { return partNumber; } }
         public String Manufacturer { get { return manufacturer; } }
         public String Description { get { return description; } }
         public Double PointValue { get { return points; } }
         public Boolean IsDrop { get { return drop; } }

      #endregion

      #region Constructors

         public Equipment(SQLiteDataReader row)
         {
            partNumber = row["Part"] as String;
            manufacturer = row["Manufacturer"] as String;
            description = row["Description"] as String;
            points = Double.Parse(row["Points"].ToString());
            drop = Boolean.Parse(row["IsDrop"] as String);
         }

         public Equipment(String iPart, String iManu, String iDesc, String iPoint, String iDrop)
         {
         partNumber = iPart;
         manufacturer = iManu;
         description = iDesc;
         points = double.Parse(iPoint);
         drop = Boolean.Parse(iDrop);
         }

      #endregion

      public int CompareTo(Equipment b)
      {
         return partNumber.CompareTo(b.partNumber);
      }
   }
}
